package cn.itsy.dao;


import cn.itsy.pojo.Emp;
import cn.itsy.pojo.Empact;
import cn.itsy.pojo.EmpandEmpact;
import cn.itsy.pojo.Pactext;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;


@Repository
public class Empactdaoimpl implements Empactdao {
    @Resource
    private JdbcTemplate jt;

    @Override
    public List<EmpandEmpact> list(String sql) {
        List<EmpandEmpact> query = jt.query(sql, new BeanPropertyRowMapper<EmpandEmpact>(EmpandEmpact.class));
        return query;
    }

    @Override
    public List<Emp> emplist(String sql) {
        List<Emp> query = jt.query(sql, new BeanPropertyRowMapper<Emp>(Emp.class));
        return query;
    }

    @Override
    public List<Pactext> paclist(String sql) {
        List<Pactext> query = jt.query(sql, new BeanPropertyRowMapper<Pactext>(Pactext.class));
        return query;
    }

    @Override
    public List<Empact> eaclist(String sql) {
        List<Empact> query = jt.query(sql, new BeanPropertyRowMapper<Empact>(Empact.class));
        return query;
    }

    @Override
    public void add(String sql) {
        jt.update(sql);
    }

    @Override
    public void update(String sql) {
        jt.update(sql);
    }

    @Override
    public void delete(String sql) {
        jt.update(sql);
    }

    @Override
    public List<EmpandEmpact> emplist2(String sql) {
        List<EmpandEmpact> query = jt.query(sql, new BeanPropertyRowMapper<EmpandEmpact>(EmpandEmpact.class));
        return query;
    }
}
